package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.vo.SysQuarterlyCategoryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysQuarterlyCategoryMapper;
import com.ruoyi.system.domain.SysQuarterlyCategory;
import com.ruoyi.system.service.ISysQuarterlyCategoryService;

/**
 * 季刊类别Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-29
 */
@Service
public class SysQuarterlyCategoryServiceImpl implements ISysQuarterlyCategoryService 
{
    @Autowired
    private SysQuarterlyCategoryMapper sysQuarterlyCategoryMapper;

    /**
     * 查询季刊类别
     * 
     * @param categoryId 季刊类别主键
     * @return 季刊类别
     */
    @Override
    public SysQuarterlyCategory selectSysQuarterlyCategoryByCategoryId(Long categoryId)
    {
        return sysQuarterlyCategoryMapper.selectSysQuarterlyCategoryByCategoryId(categoryId);
    }

    /**
     * 查询季刊类别列表
     * 
     * @param sysQuarterlyCategory 季刊类别
     * @return 季刊类别
     */
    @Override
    public List<SysQuarterlyCategoryVo> selectSysQuarterlyCategoryList(SysQuarterlyCategory sysQuarterlyCategory)
    {
        return sysQuarterlyCategoryMapper.selectSysQuarterlyCategoryList(sysQuarterlyCategory);
    }

    /**
     * 新增季刊类别
     * 
     * @param sysQuarterlyCategory 季刊类别
     * @return 结果
     */
    @Override
    public int insertSysQuarterlyCategory(SysQuarterlyCategory sysQuarterlyCategory)
    {
        sysQuarterlyCategory.setCreateTime(DateUtils.getNowDate());
        return sysQuarterlyCategoryMapper.insertSysQuarterlyCategory(sysQuarterlyCategory);
    }

    /**
     * 修改季刊类别
     * 
     * @param sysQuarterlyCategory 季刊类别
     * @return 结果
     */
    @Override
    public int updateSysQuarterlyCategory(SysQuarterlyCategory sysQuarterlyCategory)
    {
        sysQuarterlyCategory.setUpdateTime(DateUtils.getNowDate());
        return sysQuarterlyCategoryMapper.updateSysQuarterlyCategory(sysQuarterlyCategory);
    }

    /**
     * 批量删除季刊类别
     * 
     * @param categoryIds 需要删除的季刊类别主键
     * @return 结果
     */
    @Override
    public int deleteSysQuarterlyCategoryByCategoryIds(Long[] categoryIds)
    {
        return sysQuarterlyCategoryMapper.deleteSysQuarterlyCategoryByCategoryIds(categoryIds);
    }

    /**
     * 删除季刊类别信息
     * 
     * @param categoryId 季刊类别主键
     * @return 结果
     */
    @Override
    public int deleteSysQuarterlyCategoryByCategoryId(Long categoryId)
    {
        return sysQuarterlyCategoryMapper.deleteSysQuarterlyCategoryByCategoryId(categoryId);
    }
}
